<template>
	<view style="padding: 10rpx;">
		<view>粮食列表</view>
		<uni-list>
			<uni-list-item v-for="item in dataList" :key="item.id" direction="column" title="列表左侧带略缩图" rightText="右侧文字">
				<template v-slot:header>
					<view>粮食名称：<text>{{item.grainName}}</text></view>
				</template>
				<template v-slot:body>
					<view style="margin: 15rpx 0rpx;">
						<view>粮食编号：<text>{{item.grainCode}}</text></view>
						<view>收购价格：<text>{{item.purchasePrice}}元</text></view>
						<view>出售价格：<text>{{item.sellPrice}}元</text></view>
					</view>
				</template>
				<template v-slot:footer>
					<view style="text-align: right;">
						<u-button type="default" size="mini" style="margin-left: 10rpx;">查看</u-button>
						<u-button type="primary" size="mini" style="margin-left: 10rpx;">编辑</u-button>
					</view>
				</template>
			</uni-list-item>
		</uni-list>
		
		<MyTabbar />
	</view>
</template>

<script>
	import {
		listGrainType
	} from "@/api/base/grainType.js";
	export default {
		data() {
			return {
				dataList: [],
				queryParams:{
					pageNum:1,
					pageSize:10
				}
			}
		},
		onShow() {
			this.loadData();
		},
		methods: {
			loadData() {
				listGrainType(this.queryParams).then(res => {
					if (res.code == 200) {
						this.dataList = res.rows;
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	
</style>
